package com.smartcanteen.dish.mapper;


import com.smartcanteen.dish.domain.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishFlavorMapper {

    void insertBatch(@Param("flavorList") List<DishFlavor> flavorList);

    @Select("select * from sc_dish_flavor where dish_id = #{id}")
    List<DishFlavor> getByDishId(Integer id);

    @Delete("delete from sc_dish_flavor where dish_id = #{dishId}")
    void deleteByDishId(Integer dishId);

    void deleteBatch(@Param("ids") List<Integer> ids);
}
